package models;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;

import play.db.ebean.Model;

/**
 * Hierarchy between two resources
 * 
 * @author june
 * 
 */
@Entity
@Table(name = "resources_hierarchy")
public class ResourceHierarchy extends Model {
	
	@EmbeddedId
	private ResourceHierarchyPK hierarchyPK;
	
	public static Finder<ResourceHierarchyPK, ResourceHierarchy> find = new Finder<ResourceHierarchyPK, ResourceHierarchy>(ResourceHierarchyPK.class, ResourceHierarchy.class);
	
	public ResourceHierarchy() {
	}
	
	public ResourceHierarchy(ResourceHierarchyPK hierarchyPK) {
		this.hierarchyPK = hierarchyPK;
	}
	
	public ResourceHierarchyPK getHierarchyPK() {
		return hierarchyPK;
	}
	
	public void setHierarchyPK(ResourceHierarchyPK hierarchyPK) {
		this.hierarchyPK = hierarchyPK;
	}
	
	@Override
	public String toString() {
		return "ResourceHierarchy [hierarchyPK=" + hierarchyPK + "]";
	}
	
}
